package com.base.common.enums;

/**
 * @author admin
 * @date 2020/5/19 AM10:15
 */
public enum ResponseCodeEnum implements ErrorEnum {
    /**
     * 成功
     */
    SUCCESS("0", "SUCCESS", "成功"),
    /**
     * 失败
     */
    UNKNOWN_ERROR("-1", "FAIL", "失败"),
    /**
     * 进入服务熔断，调用失败
     */
    FALLBACK_ERROR("-2", "进入服务熔断，调用失败", "进入服务熔断，调用失败"),
    /**
     * 数据库参数有误，调用失败
     */
    SQL_ERROR("-3", "数据库参数有误，调用失败", "数据库参数有误，调用失败");

    private String code;
    private String codeMsg;
    private String desc;

    private ResponseCodeEnum(String code, String codeMsg, String desc) {
        this.code = code;
        this.codeMsg = codeMsg;
        this.desc = desc;
    }

    /**
     * 获取Code
     *
     * @return
     */
    @Override
    public String getCode() {
        return code;
    }

    /**
     * 获取CodeMsg
     *
     * @return
     */
    @Override
    public String getCodeMsg() {
        return codeMsg;
    }

    /**
     * 获取Desc
     *
     * @return
     */
    @Override
    public String getDesc() {
        return desc;
    }
}
